import 'package:flutter/material.dart';
import 'package:news/com.comm/widget/translate_export_view.dart';
import 'package:news/com.comm/widget/translate_global_set.dart';

import '../widget/parse_translate_excel.dart';
import '../widget/translate_show_list.dart';

/**
 * 多语言预览
 */
void showTranslateShowDialog(BuildContext context, String resPath) {
  showDialog(
    context: context,
    builder: (BuildContext context) {
      return AlertDialog(
        title: Text(
          "多语言预览",
          style: TextStyle(fontSize: 14),
        ),
        shape:
            RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
        content: TranslateShowList(
          resPath: resPath,
        ),
      );
    },
  );
}

/**
 * 多语言导出显示dialog
 */
void showExportLanguageDialog(BuildContext context, final String resPath) {
  showDialog(
    context: context,
    builder: (BuildContext context) {
      return AlertDialog(
          title: Text(
            "多语言导出",
            style: TextStyle(fontSize: 14),
          ),
          shape:
              RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
          content: TranslateExportView(resPath: resPath));
    },
  );
}

/**
 * 多语言文档解析 dialog
 */
void showParseTranslateShowDialog(BuildContext context, String resPath) {
  showDialog(
    context: context,
    builder: (BuildContext context) {
      return AlertDialog(
        title: Text(
          "多语言解析",
          style: TextStyle(fontSize: 14),
        ),
        content: ParseTranslateExcel(
          resPath: resPath,
        ),
      );
    },
  );
}

/**
 * 多语言全局设置 dialog
 */
void showTranslateGlobalSetDialog(BuildContext context) {
  showDialog(
    context: context,
    builder: (BuildContext context) {
      return AlertDialog(
        title: Text(
          "多语言设置",
          style: TextStyle(fontSize: 14),
        ),
        content: TranslateGlobalSet(),
      );
    },
  );
}
